-
Notifications
You must be signed in to change notification settings - Fork 814
Add mention of extended IProductSnapshot interfaces #7680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
sofietoft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @jemayn !
I've made some small suggestions (read: I've totally rewritten your PR, sorry! 🙈 )
Please take a look, and tell me what you think!
| ``` | ||
|
|
||
| {% hint style="info" %} | ||
| `IProductSnapshot` is the base model for what Umbraco Commerce needs. If you want to include images or measurements (for example, if you need weight-based shipping), then there are other interfaces you can return. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've attempted to make these sentences more direct. What do you think?
| `IProductSnapshot` is the base model for what Umbraco Commerce needs. If you want to include images or measurements (for example, if you need weight-based shipping), then there are other interfaces you can return. | |
| `IProductSnapshot` is the base model for enriching the Umbraco Commerce product model. To include images or custom measurements, such as weight-based shipping, more specific interfaces are available. |
|
|
||
| {% hint style="info" %} | ||
| `IProductSnapshot` is the base model for what Umbraco Commerce needs. If you want to include images or measurements (for example, if you need weight-based shipping), then there are other interfaces you can return. | ||
| `IProductSnapshotWithImage`, `IProductSnapshotWithCategories` & `IProductSnapshotWithMeasurements` are all valid return types that allows you to enrich the product model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there are in fact more available interfaces - you probably know that better than me ;)
But how about we use a list here? 🤔
| `IProductSnapshotWithImage`, `IProductSnapshotWithCategories` & `IProductSnapshotWithMeasurements` are all valid return types that allows you to enrich the product model. | |
| Valid interfaces include, but are not limited to: | |
| * `IProductSnapshotWithImage` | |
| * `IProductSnapshotWithCategories` | |
| * `IProductSnapshotWithMeasurements` |
📋 Description
I've recently spent way more time than I'd like to admit on figuring out how to add a weight onto a product in Umbraco Commerce when fetching products through a Product Adapter.
This PR adds a note on the other extended IProductSnapshot interfaces that add additional data to your product that may be useful.
✅ Contributor Checklist
I've followed the Umbraco Documentation Style Guide and can confirm that:
Product & Version (if relevant)
I've been working on Umbraco Commerce 16.4.1, but I'd assume it to be the same for all other versions.
📚 Helpful Resources